Skip to content

Fix #2982: Avoid instantiating to Nothing in some situations #3834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2018

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jan 14, 2018

If variance == 0, we have to choice whether to instantiate a type variable
to its lower or upper bound. We used to always pick the lower bound, but now
we pick the upper bound if the lower bound is Nothing.

If variance == 0, we have to choice whether to instantiate a type variable
to its lower or upper bound. We used to always pick the lower bound, but now
we pick the upper bound if the lower bound is Nothing.
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this kind of duplicate the existing logic in IsFullyDefinedAccumulator (https://github.com/dotty-staging/dotty/blob/1ab60276f5684ec7c80f3fed3c0f52ab491ecca6/compiler/src/dotty/tools/dotc/typer/Inferencing.scala#L115), I plan to try to share more core between it and interpolateUndetVars, but until then this is fine I guess.

@odersky odersky merged commit e64e2d3 into scala:master Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants